package com.nbgs.demo.controller;

import com.nbgs.demo.common.Result;
import com.nbgs.demo.model.Area;
import com.nbgs.demo.service.AreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@CrossOrigin("*")
@Slf4j
public class AreaNameController {
    @Autowired
    private AreaService areaService;

    @GetMapping("showDown")
    public Result showDown(){
        log.info("查找区域");
        List<String> areaNames = areaService.areaName();
        return Result.success(areaNames);

    }
}
